<template>
<div>
  <el-dropdown :hide-on-click="false">
    <el-avatar :src="require('../assets/icon.jpg')"></el-avatar>
    <el-dropdown-menu slot="dropdown">
      <el-dropdown-item>
        <router-link to="/person" style="text-decoration: none;color:#606266;">个人中心</router-link>
      </el-dropdown-item>
      <el-dropdown-item>
        <router-link to="/personSet" style="text-decoration: none;color:#606266;">设置</router-link>
      </el-dropdown-item>
      <el-dropdown-item @click.native="layout">退出</el-dropdown-item>
    </el-dropdown-menu>
  </el-dropdown>
</div>
</template>

<script>
export default {
  name: "DropDown",
  methods: {
    layout() {
      console.log('退出');
      sessionStorage.removeItem('user');
      this.$router.push('/Login');
    }
  }
}
</script>

<style scoped>
.el-dropdown-link {
  cursor: pointer;
  color: #409EFF;
}
.el-icon-arrow-down {
  font-size: 12px;
}
</style>